<style>
#UplateBrowse{
	width:900px;
}
#UplateBrowse fieldset.left{
	float:left;
}
#UplateBrowse div.left{
	float:left;
}
#UplateBrowse div.left label.left{
	width:70px;
}
#UplateResult{
	margin:2px 2px 0px 0px;
}
#UplateResult table tr td{
	vertical-align:top;
}
#UplateResult table tr td input.edit,
#UplateResult table tr td input.delete{
	position:absolute;
	margin:0px;
	display:none;
	padding:0px;
	width:20px;
	height:20px;
	cursor:pointer;
	background-position:center center;
	background-color:#fff;
	border:1px solid #000;
}
#UplateResult table tr td input.edit{
	margin-left:21px;
}
#UplateResult table tr:hover td input.edit,
#UplateResult table tr:hover td input.delete{
	display:block;
}
#UplateResult table tr td.napomena{
	font-size:10px;
}
#UplateResult table tr td[razvedena=raz0]{
	cursor:pointer;
	font-weight:bolder;
	background:url(gui/icons/yapyap.gif) no-repeat 95% 5%;
}
#UplateResult table tr td[razvedena=raz0]:hover{
	background-color:{{$highlight}};
	color:{{$highlighttext}};
}
#UplateResult table tr td a[imaugovor='0']:hover{
	background-color:transparent;
}
#UplateBrowse #SubmitButton{
	float:right;
}
</style>
<div id="UplateBrowse">
	<form method="post" action="javascript:void(0)" onsubmit="submitForm(this,'izvodi.php',this.method,'setContent',1)" class="area">
		<input type="hidden" name="a" value="uplate" />
		
		<h1>Uplate</h1>
		<fieldset>
			<legend>Filter:</legend>
			
			<fieldset class="left">
				<legend>Datum:</legend>
				<label class="left" for="filter_date_od">od:</label>
				<input type="text" class="dateInput" name="filter_date_od" id="filter_date_od" value="{{$filter_date_od}}" />
				<input type="button" class="datePicker" onclick="displayDatePicker('filter_date_od',this)" />
				<br clear="all" />
				<label class="left" for="filter_date_do">do:</label>
				<input type="text" class="dateInput" name="filter_date_do" id="filter_date_do" value="{{$filter_date_do}}" />
				<input type="button" class="datePicker" onclick="displayDatePicker('filter_date_do',this)" />
			</fieldset>
			
			<div class="left">
				<label class="left" for="filter_izvod">Izvod:</label>
				<input type="text" name="filter_izvod" id="filter_izvod" value="{{$filter_izvod}}" />
				<br clear="all" />
				<label class="left" for="filter_ugovor">Ugovor:</label>
				<input type="text" name="filter_ugovor" id="filter_ugovor" value="{{$filter_ugovor}}" />
				<br clear="all" />
				<label class="left" for="filter_tip_uplate">Tip uplate:</label>
				<select name="filter_tip_uplate" id="filter_tip_uplate">
					<option value="-1">---</option>
					{{%loop start tip_uplate_id}}
					<option value="{{$tip_uplate_id}}" {{$selected_filter_tip_uplate}}>{{$tip_uplate_name}}</option>
					{{%loop end}}
				</select>
			</div>
			
			<div class="left">
				<label class="left" for="filter_komitent">Komitent:</label>
				<input type="text" name="filter_komitent" id="filter_komitent" value="{{$filter_komitent}}" />
				
				<br clear="all" />
				<label class="left" for="filter_razvedena">Razvedena:</label>
				<select name="filter_razvedena" id="filter_razvedena">
					<option value="0">---</option>
					<option value="1" {{$selected_nerazvedena}}>NE</option>
					<option value="2" {{$selected_razvedena}}>DA</option>
				</select>
				<br clear="all" />
				<input type="submit" id="SubmitButton" value="traži" />
			</div>
		
		</fieldset>
	</form>
	<br clear="all" />
	<div class="area" id="UplateResult">
		{{$comment_start}}
		<span class="info">Ukupno:&nbsp;{{$ukupno}}</span>
		<textarea style="display:none" id="filter_query">{{$filter_query}}</textarea>
		<ul class="letter_filter">
			{{%loop start page}}
			<li><a href="javascript:void(0)" onclick="LoadRSDoc('izvodi.php?'+document.getElementById('filter_query').value+'&page={{$page}}','setContent')" {{$page_curr}}>{{$page}}</a></li>
			{{%loop end}}
		</ul>
		<br clear="all" />
		<table width="100%">
			<tr class="head" align="center">
				<td>izvod</td>
				<td>konto</td>
				<td>ugovor</td>
				<td>komitent</td>
				<td>iznos</td>
				<td>tip uplate</td>
				<td>datum</td>
				<td>napomena</td>
				<td>
					razvedena<br />
					<a href="javascript:void(0)" onclick="izvodUplataLinkAll(this.parentNode.parentNode.parentNode)" title="razvedi sve nerazvedene">
						<img src="gui/icons/yapyap.gif" border="0" />
					</a>
				</td>
			</tr>
			{{%loop start uplataid}}
			<tr uplataid="{{$uplataid}}" razvedena="{{$razvedena_int}}">
				<td>
					<input type="button" class="delete" title="obriši uplatu" onclick="izvodiDeleteUplata(this,'{{$uplataid}}','{{$ugoid}}','{{$komitent_id}}','{{$komitent}}');" />
					<input type="button" class="edit" title="izmeni uplatu" onclick="LoadRSDoc('izvodi.php?a=uplataEdit&id={{$uplataid}}&fq='+escape(document.getElementById('filter_query').value),'setContent');" />
					{{$izvod}}
				</td>
				<td>{{$konto}}</td>
				<td title="{{$ugoid}}"><a imaugovor="{{$imaugovor}}" href="javascript:void(0)" onclick="UplataBrowseUgovor(this,'{{$ugoid}}','{{$uplataid}}');">{{$ugobroj}}</a></td>
				<td><a href="javascript:void(0)" onclick="blankTarget('LoadRSDoc(\'komitenti.php?a=displayOne&id={{$komitent_id}}\',\'setContent\')')">{{$komitent_id}}.&nbsp;{{$komitent}}</a></td>
				<td align="right">{{$iznos}}</td>
				<td>{{$tipuplate}}</td>
				<td>{{$datum}}</td>
				<td class="napomena">{{$napomena}}</td>
				<td align="center" razvedena="raz{{$razvedena_int}}" onclick="var raz=this.getAttribute('razvedena').replace(/raz/,''); raz=parseInt(raz); if(raz<1){if(parseInt('{{$ugoid}}')>0){izvodUplataLink('{{$uplataid}}')}else{alert('Uplata nije vezana ni za jedan ugovor.')}}">
					{{$razvedena}}
				</td>
			</tr>
			{{%loop end}}
		</table>
		{{$comment_end}}
	</div>
</div>